<div class="row-fluid shop_header" id="shop_header">
    <?php if(!defined('FRONT_CACHE_STATE') or FRONT_CACHE_STATE != 'true') { ?>
        <div class="span3 offset1">
            <?php
            $frontCurrency = $this->frontwebsite()->getFrontCurrency();
            if($frontCurrency and count($frontCurrency)>1) {
                foreach($frontCurrency as $currency_value) {
                    if($currency_value['currency_state'] == '0') continue;
                    ?>
                    <a style="cursor: pointer;" href="<?php echo $this->url('shopfront/default/currency-code', array('action'=>'chanageCurrency','code'=>$currency_value['currency_code'])); ?>"><span class="badge <?php if($this->frontwebsite()->getFrontDefaultCurrency()) { if ($this->frontwebsite()->getFrontDefaultCurrency() == $currency_value['currency_code']) echo 'badge-success'; } elseif ($currency_value['currency_type'] == 1) echo 'badge-success'; ?>"><?php echo $currency_value['currency_name']; ?></span></a>
                <?php } } ?>
        </div>
        <div class="span7 shop_header_right">
            <ul class="db-nav">
                <?php
                $shop_top_menu = $this->frontwebsite()->shopFrontMenu(1);
                if(is_array($shop_top_menu) and !empty($shop_top_menu)) {
                    foreach($shop_top_menu as $top_value) {
                        ?><li class="item"><a href="<?php echo $top_value['navigation_url']; ?>" <?php if($top_value['navigation_new_window'] == 1) echo 'target="_blank"'; ?>><?php echo $top_value['navigation_title']; ?></a></li><li class="item split"></li>
                    <?php } } ?>
                <li class="item"><a href="<?php echo $this->url('frontcart/default'); ?>"><?php echo $this->translate('购物车'); ?>
                        <span class="badge badge-success" id="top_cart" style="margin:0;<?php if ($this->frontwebsite()->cartGoodsNum() <= 0) echo 'display:none;'; ?>"><?php echo $this->frontwebsite()->cartGoodsNum(); ?></span>
                    </a></li>
                <li class="item split"></li><li class="item"><a href="<?php echo $this->url('fronthome/default'); ?>"><?php echo $this->translate('用户中心'); ?></a></li>
                <li class="item split"></li><li class="item"><a href="<?php echo $this->url('frontorder/default'); ?>"><?php echo $this->translate('我的订单'); ?></a></li>
                <?php if($this->frontwebsite()->getUserSession('user_id') == '') {  ?><li class="item split"></li>
                <li class="item"><a href="<?php echo $this->url('frontuser/default',array('action'=>'login')); ?>"><?php echo $this->translate('登录'); ?></a></li><li class="item split"></li>
                <li class="item"><a href="<?php echo $this->url('frontuser/default',array('action'=>'register')); ?>"><?php echo $this->translate('注册'); ?></a>
                <?php } ?>
                <?php if($this->frontwebsite()->getUserSession('user_id') != '') {  ?>
                    <li class="item split"></li><li class="item"><?php echo $this->translate('欢迎您'); ?><a href="<?php echo $this->url('fronthome/default', array('action'=>'useredit')); ?>"><font color="#ED145B"><?php echo $this->escapeHtml($this->frontwebsite()->getUserSession('user_name')); ?></font></a><a href="<?php echo $this->url('frontuser/default',array('action'=>'loginout')); ?>"><?php echo $this->translate('退出'); ?></a></li>
                <?php } else { ?>
                    <li class="item split"></li>
                    <?php
                    if($this->frontwebsite()->getUserIni('front_other_login_show') == '1') {
                        $otherLoginArray = $this->frontwebsite()->getUserOtherLoginIni();
                        if(!empty($otherLoginArray)) {
                            foreach($otherLoginArray as $othKey => $othValue) {
                                if($othValue['login_state'] == 'true') {
                                    $othKey = strtolower($othKey);
                                    ?>
                                    <li class="item"><a href="<?php echo $this->url('frontuser/default',array('action'=>'otherlogin'), array('query'=>array('login_type'=>$othKey))); ?>"><img src="<?php echo $this->basePath('public/img/login/'.$othKey.'_login.png'); ?>"></a></li>
                                    <?php
                                }
                            }
                        }
                    }
                    ?>
                <?php } ?>
            </ul>
        </div>
    <?php } ?>
</div>
<?php if(defined('FRONT_CACHE_STATE') and FRONT_CACHE_STATE == 'true') { ?>
    <script>
        $.get('<?php echo $this->url('shopfront/default',array('action'=>'ajaxheader')); ?>',{}, function(html){
            $("#shop_header").html(html);
        });
    </script>
<?php } ?>

<div class="row-fluid">
	<div class="span5 offset1" id="shop_logo_img">
    <a href="<?php echo $this->url('shopfront/default'); ?>"><img src="<?php echo ($this->frontwebsite()->websiteInfo('shop_logo') != '' ? $this->basePath($this->frontwebsite()->websiteInfo('shop_logo')) : $this->basePath('/public/css/default/img/shop_logo.png')); ?>" border="0"></a>
    <?php if($this->frontwebsite()->websiteInfo('shop_QRcode')) { ?>
        <img alt="<?php echo $this->translate('手机扫描后，访问手机站点'); ?>" title="<?php echo $this->translate('手机扫描后，访问手机站点'); ?>" src="<?php echo  $this->basePath($this->frontwebsite()->createQRcode($this->serverUrl().$this->url('mobile/default'), $this->serverUrl().$this->url('mobile/default'), 'shop')); ?>" style="width: 60px;height: 60px;">
    <?php } ?>

    </div>
    <div class="span5" id="shop_top_search">
    <form method="get" class="form-search" action="<?php echo $this->url('frontgoodslist/default', array('action'=>'goodsSearch')); ?>">
        <div class="input-append span12">
            <input type="text" class="search-query span9" name="keywords" value="<?php echo isset($_GET['keywords']) ? $this->escapehtml($_GET['keywords']) : ''; ?>" placeholder="<?php echo $this->translate('简简单单搜索'); ?>">  <button type="submit" class="btn"><?php echo $this->translate('商品搜索'); ?></button>
        </div>
    </form>
    </div>
</div>

<div class="row-fluid" id="shop_header_menu">
	<div class="span10 offset1">
    	<ul>
    		<li <?php if($this->dbTongJiPage == 'index') echo 'class="active"'; ?>><a href="<?php echo $this->url('shopfront/default'); ?>"><?php echo $this->translate('首页'); ?></a></li>
    		<?php
    		$shop_middle_menu = $this->frontwebsite()->shopFrontMenu(2);
			if(is_array($shop_middle_menu) and !empty($shop_middle_menu)) {
				foreach($shop_middle_menu as $middle_value) {
			?><li><a href="<?php echo $middle_value['navigation_url']; ?>" <?php if($middle_value['navigation_new_window'] == 1) echo 'target="_blank"'; ?>><?php echo $middle_value['navigation_title']; ?></a></li>
			<?php } } ?>
    	</ul>
	</div>
</div>